package wangm.controller;

import org.aspectj.lang.annotation.*;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;

/**
 * description
 *
 * @author zk
 * @since 2018/7/7
 */
@Component
@Aspect
public class AopTest implements Ordered {

    @Pointcut(value = "@annotation(org.springframework.web.bind.annotation.RequestMapping)")
    public void pointCut1(){
        System.out.println("point cut is or not use");
    }

    @Before(value = "pointCut1()")
    public void before1(){
        System.out.println("before 1");
    }

    @After(value = "pointCut1()")
    public void after1(){
        System.out.println("after 1");
    }

    @AfterReturning("pointCut1()")
    public void returnObject1(){
        System.out.println("return 1");
    }

    @Override
    public int getOrder() {
        return 1;
    }
}
